﻿using Microsoft.SharePoint.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Albatross.SharePoint.Explorer.ViewModels {
	public class FormViewModel  : ClientObjectViewModel{
		public FormViewModel(ClientContext context, string name, Form form) :base(context, name, form){
		}
		public Form Form { get { return (Form)ClientObject; } }
		public override string GetTreeItemTitle() {
			if (Name == string.Empty) {
				return string.Format("{0} ({1})", Form.FormType, Form.ServerRelativeUrl);
			} else {
				return Name;
			}
		}
		public override string GetContentTitle() {
			return string.Format("{0} ({1})", Form.FormType, Form.ServerRelativeUrl);
		}
	}
}
